package com.baidu.location;

import android.telephony.NeighboringCellInfo;
import android.telephony.TelephonyManager;
import java.util.Iterator;
import java.util.List;

public final class u
{
  public int a = -1;
  public int b = -1;
  public int c = -1;
  public int d = -1;
  public long e = 0L;
  public int f = -1;
  public char g = '\0';

  public final boolean a()
  {
    return (System.currentTimeMillis() - this.e >= t.e());
  }

  public final boolean a(u paramu)
  {
    return ((this.a != paramu.a) || (this.b != paramu.b) || (this.d != paramu.d));
  }

  public final boolean b()
  {
    return ((this.a < 0) || (this.b <= 0));
  }

  public final String c()
  {
    StringBuffer localStringBuffer = new StringBuffer(128);
    localStringBuffer.append(this.b + 23);
    localStringBuffer.append("H");
    localStringBuffer.append(this.a + 45);
    localStringBuffer.append("K");
    localStringBuffer.append(this.d + 54);
    localStringBuffer.append("Q");
    localStringBuffer.append(this.c + 203);
    return localStringBuffer.toString();
  }

  public final String d()
  {
    while (true)
    {
      int i;
      try
      {
        Object localObject2 = t.c(this.h).getNeighboringCellInfo();
        if ((localObject2 == null) || (((List)localObject2).isEmpty()))
          break label298;
        String str = "&nc=";
        localObject2 = ((List)localObject2).iterator();
        i = 0;
        if (!(((Iterator)localObject2).hasNext()))
          break label295;
        NeighboringCellInfo localNeighboringCellInfo = (NeighboringCellInfo)((Iterator)localObject2).next();
        if (i == 0)
        {
          if (localNeighboringCellInfo.getLac() != this.a)
          {
            str = str + localNeighboringCellInfo.getLac() + "|" + localNeighboringCellInfo.getCid() + "|" + localNeighboringCellInfo.getRssi();
            break label303:
          }
          str = str + "|" + localNeighboringCellInfo.getCid() + "|" + localNeighboringCellInfo.getRssi();
          break label303:
        }
        if (i >= 8)
          break label295;
        if (localNeighboringCellInfo.getLac() != this.a)
        {
          str = str + ";" + localNeighboringCellInfo.getLac() + "|" + localNeighboringCellInfo.getCid() + "|" + localNeighboringCellInfo.getRssi();
          break label303:
        }
        str = str + ";|" + localNeighboringCellInfo.getCid() + "|" + localNeighboringCellInfo.getRssi();
      }
      catch (Exception localObject1)
      {
        localObject1 = null;
        ak.e();
        return localObject1;
      }
      label295: continue;
      label298: Object localObject1 = null;
      continue;
      label303: i += 1;
    }
  }

  public final String toString()
  {
    StringBuffer localStringBuffer = new StringBuffer(128);
    localStringBuffer.append("&nw=");
    localStringBuffer.append(t.a(this.h).g);
    localStringBuffer.append(String.format("&cl=%d|%d|%d|%d&cl_s=%d", new Object[] { Integer.valueOf(this.c), Integer.valueOf(this.d), Integer.valueOf(this.a), Integer.valueOf(this.b), Integer.valueOf(this.f) }));
    localStringBuffer.append("&cl_t=");
    localStringBuffer.append(this.e);
    if ((t.b(this.h) != null) && (t.b(this.h).size() > 0))
    {
      int j = t.b(this.h).size();
      localStringBuffer.append("&clt=");
      int i = 0;
      if (i < j)
      {
        u localu = (u)t.b(this.h).get(i);
        if (localu.c != this.c)
          localStringBuffer.append(localu.c);
        localStringBuffer.append("|");
        if (localu.d != this.d)
          localStringBuffer.append(localu.d);
        localStringBuffer.append("|");
        if (localu.a != this.a)
          localStringBuffer.append(localu.a);
        localStringBuffer.append("|");
        if (localu.b != this.b)
          localStringBuffer.append(localu.b);
        localStringBuffer.append("|");
        if (i != j - 1)
          localStringBuffer.append(localu.e / 1000L);
        while (true)
        {
          while (true)
          {
            localStringBuffer.append(";");
            i += 1;
          }
          localStringBuffer.append((System.currentTimeMillis() - localu.e) / 1000L);
        }
      }
    }
    return localStringBuffer.toString();
  }
}